package pres.lnk.learn.designpattern.q_iterator;

import pres.lnk.learn.designpattern.q_iterator.impl.NameRepository;

/**
 * 迭代器模式
 * @Author lnk
 * @Date 2018/5/31
 */
public class Main {
    public static void main(String[] args) {
        NameRepository repository = new NameRepository();
        Iterator<String> iterator = repository.getIterator();
        while (iterator.hasNext()){
            String name = iterator.next();
            System.out.println("Name: " + name);
        }
    }
}
